package com.zhuss.team.answer;

import com.zhuss.bean.bo.team.answer.CreateAnswerBo;
import com.zhuss.common.OperateService;
import com.zhuss.common.Processor;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/26 12:55
 */
@Component("answerOperateService")
public class AnswerOperateService implements OperateService<Void,Object> {

    @Autowired
    @Qualifier("answerCreate")
    private Processor<Object, CreateAnswerBo> answerCreate;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Void create(Object o) throws WpsException {
        CreateAnswerBo bo = (CreateAnswerBo) o;
        answerCreate.process(bo);
        return null;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Void update(Object o) throws WpsException {
        return null;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Void delete(Object o) throws WpsException {
        return null;
    }
}
